import React, { useState, useEffect, useMemo, memo } from 'react'
import PropTypes from 'prop-types'

const Child = memo(
	(props) => {
		console.log(3333)
		return <div className="child-container">这是子组件，内容固定，父组件更新的时候，我可以不用更新</div>
	},
	(pre, next) => {
		const keys = Reflect.ownKeys(pre)
		return keys.every((i) => pre[i] === next[i])
	}
)

Child.defaultProps = {
	val: '',
}

Child.propTypes = {
	val: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
}

export default Child
